# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj \
# RUN:  -code-model=small -relocation-model=pic -o - \
# RUN:   | extract-section .text -h \
# RUN:   | FileCheck %s

#------------------------------------------------------------------------------
# Tests PC-Relative Calls' offsets. The rest requires relocation and tested
# appropriately elsewhere.
#------------------------------------------------------------------------------

#
# <BACKWARD>
# 00  CHECK:      4e71
# 02  CHECK-SAME: 4e75
#
# <PCI>
# 04  CHECK-SAME: 4ebb 08fa
# 08  CHECK-SAME: 4ebb 080a
#
# <PCD>
# 0c  CHECK-SAME: 4eba fff2
# 10  CHECK-SAME: 4eba 0002
#
# <FORWARD>
# 14  CHECK-SAME: 4e71
# 16  CHECK-SAME: 4e75
--- |

  define dso_local void @BACKWARD() { entry: ret void }
  define dso_local void @PCI()      { entry: ret void }
  define dso_local void @PCD()      { entry: ret void }
  define dso_local void @FORWARD()  { entry: ret void }

...
--- # BACKWARD
name: BACKWARD
body: |
  bb.0:
    NOP
    RTS

...
--- # PCI
name: PCI
body: |
  bb.0:
    CALLk @BACKWARD, $d0
    CALLk @FORWARD, $d0

...
--- # PCD
name: PCD
body: |
  bb.0:
    CALLq @BACKWARD
    CALLq @FORWARD

...
--- # FORWARD
name: FORWARD
body: |
  bb.0:
    NOP
    RTS

...
